
<html >
<head>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    {% block title%}<title>列表页</title>{% endblock %}
</head>
<body>
     <!-- 导航栏 -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <a class="navbar-brand" href="{% url "server_list" %}">Cover CC MockServer</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active" id="menu_server"><a href="{% url "server_list" %}">SERVER</a></li>
            <li class="active" id="menu_router"><a href="{% url "router_list" %}">Router</a></li>
              <li class="active" id="menu_response"><a href="{% url "response_list" %}">Response</a></li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
              {%  if request.user.is_authenticated %}
                   <li><a href="#">{{request.user.username }}</a></li>
                  <li><a href="{% url "login" %}">退出</a></li>
              {% endif %}

         </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>




{#  标记可被修改  #}
{% block content %}
    <div class="container theme-showcase" role="main">

      <!--查询-->
      <div class="page-header" style="margin-top: 80px;">
        <div id="navbar" class="navbar-collapse collapse" style="float:left;">
          <form class="navbar-form" method="get" action="/cc/">
            <div class="form-group">
              <input name="server_name" type="search" placeholder="Search" class="form-control" >
            </div>
            <button type="submit" class="btn btn-success" >搜索</button>
          </form>
        </div><!--/.navbar-collapse -->
        <div style="float:right;">
          <button type="submit" class="btn btn-primary" onclick="window.location.href='{% url 'add_server' %}'" style="margin-top: 8px;">添加</button>
        </div>
      </div>

      <!--表单-->
      <div class="row" >
        <div class="col-md-6" style="width: 900px;">
          <table class="table table-striped">
            <thead>
              <tr>
                <th>id</th>
                <th>name</th>
                <th>path</th>

              
              </tr>
            </thead>
            <tbody>
                {% for server in all_server %}
                    <tr>
                      <td>{{ server.id }}</td>
                      <td>{{ server.name }}</td>
                      <td>{{ server.path }}</td>
                      <td><a href="{% url "editInfo" server.id %}" >编辑</a></td>
                      <td><a href="{% url "deleteInfo" server.id %}">删除</a></td>
                </tr>
                {% endfor %}
            </tbody>
          </table>
        </div>

      </div>
</div>



{% endblock %}


    <div class="container theme-showcase" role="main">
      <div class="page-header">
      </div>
      <footer class="footer">
        <p>&copy; Cover 2020, Author:Kun&Cc</p>
      </footer>
    </div> <!-- /container -->

    
     <script>
            window.onload = function () {
                 var menu_server = document.getElementById("menu_server")
                 var menu_router = document.getElementById("menu_router")
                 var menu_response = document.getElementById("menu_response")
                menu_server.className='active'
                menu_router.className=''
                menu_response.className=''
            }
    </script>

</body>
</html>
